#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int removeElement(int* nums, int numsSize, int val) {
    int q = 0;
    int s = 0;
    int count = 0;
    while (q < numsSize)
    {
        if (nums[q] != val)
        {
            nums[s] = nums[q];
            count++;
            s++;
            q++;
        }
        else
        {
            q++;
        }
    }
    return count;
}
int main()
{
    int nums[] = { 3,4,534,6,67,87834,4,3,2,2,534 };
    int ret = removeElement(nums, sizeof(nums) / sizeof(int), 2);
    for (int i = 0; i < ret; i++)
    {
        printf("%d ", nums[i]);
    }
}